<?php

class Twitter extends TwitterAPIExchange{
	
	private $settings = array(
		'oauth_access_token' => '378387117-dyXuFFYC0oGt3Gqr5v3qHLTzwIN2yHiDBDpLl4eE',
		'oauth_access_token_secret' => 'xnf8gz7P7D69emvGeJlSga6eKgwQ7Gh8HhLxfTexwI4',
		'consumer_key' => 'gICrcjQy2uZaxnLjvrpedg',
		'consumer_secret'=> 'mmQeBYspgOqBgh16ILVFNvd0OmEROV5Iy42oDRx34'
	);
	
	function __construct(){
		$this->twitter = new TwitterAPIExchange($this->settings);
	}
	
	public function exibirTweets(){
		//obter tweets de usuários 
		$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
		$name = ltrim('@codigogm','@');
		$getfield = "?screen_name={$name}";
		$requestMethod = 'GET';
		
		//$twitter = new TwitterAPIExchange($settings);
		$response = $this->twitter->setGetfield($getfield)
							->buildOauth($url, $requestMethod)
						   ->performRequest();
		
		$response = (json_decode($response));
		return $response;
	}
}

?>